package com.bdqn.controller;

import com.bdqn.mapper.HisPatientMapper;
import com.bdqn.pojo.HisPatient;
import com.bdqn.service.HisPatientService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@CrossOrigin
@RestController
@RequestMapping("/HisPatient")
public class HisPatientController {
    @Autowired
    HisPatientService hisPatientService;
//    查询单个患者信息
    @GetMapping("/getHisPatientDANGE1")
    public HisPatient getHisPatientDANGE(@RequestParam(value = "idCard",defaultValue = "1",required = false)  String idCard){
        HisPatient hisPatient=hisPatientService.getHisPatientDANGE(idCard);
        return hisPatient;
    }
    @GetMapping("addHisPatient")
    public int addHisPatient(HisPatient hisPatient){
        int row=0;
        System.out.println(hisPatient);
        row= hisPatientService.addHisPatient(hisPatient);
        return row;
    }
}
